/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package models;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;

/**
 *
 * @author Eduardo
 */
@Entity
@Table(name = "Configuracion")
@NamedQueries({
    @NamedQuery(name = "Configuracion.findAll", query = "SELECT c FROM Configuracion c"),
    @NamedQuery(name = "Configuracion.findByIdDetalleConf", query = "SELECT c FROM Configuracion c WHERE c.idDetalleConf = :idDetalleConf"),
    @NamedQuery(name = "Configuracion.findByDescripcion", query = "SELECT c FROM Configuracion c WHERE c.descripcion = :descripcion")})
public class Configuracion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "IdDetalleConf")
    private Integer idDetalleConf;
    @Size(max = 100)
    @Column(name = "Descripcion")
    private String descripcion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "configuracion", fetch = FetchType.LAZY)
    private List<Configuracionxperfil> configuracionxperfilList;

    public Configuracion() {
    }

    public Configuracion(Integer idDetalleConf) {
        this.idDetalleConf = idDetalleConf;
    }

    public Integer getIdDetalleConf() {
        return idDetalleConf;
    }

    public void setIdDetalleConf(Integer idDetalleConf) {
        this.idDetalleConf = idDetalleConf;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public List<Configuracionxperfil> getConfiguracionxperfilList() {
        return configuracionxperfilList;
    }

    public void setConfiguracionxperfilList(List<Configuracionxperfil> configuracionxperfilList) {
        this.configuracionxperfilList = configuracionxperfilList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetalleConf != null ? idDetalleConf.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Configuracion)) {
            return false;
        }
        Configuracion other = (Configuracion) object;
        if ((this.idDetalleConf == null && other.idDetalleConf != null) || (this.idDetalleConf != null && !this.idDetalleConf.equals(other.idDetalleConf))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "models.Configuracion[ idDetalleConf=" + idDetalleConf + " ]";
    }
    
}
